package com.imti.mall.order.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.imti.mall.model.sms.pojo.SmsFlashPromotionProductRelation;
import org.apache.ibatis.annotations.*;

@Mapper
public interface FlashPromotionProductRelationMapper extends BaseMapper<SmsFlashPromotionProductRelation> {


    @Select("select id,flash_promotion_id,flash_promotion_session_id,product_id,flash_promotion_price,flash_promotion_count,flash_promotion_limit,sort from sms_flash_promotion_product_relation where product_id=#{productId}")
    @Results({
            @Result(property = "flashPromotionId",column = "flash_promotion_id"),
            @Result(property = "flashPromotionSessionId",column = "flash_promotion_session_id"),
            @Result(property = "productId",column = "product_id"),
            @Result(property = "flashPromotionPrice",column = "flash_promotion_price"),
            @Result(property = "flashPromotionCount",column = "flash_promotion_count"),
            @Result(property = "flashPromotionLimit",column = "flash_promotion_limit")
    })
    SmsFlashPromotionProductRelation flashPromotionProductRelation(@Param("productId") Long productId);
}
